﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ManagerHmsshield;

namespace IP_Refresh
{
    public partial class Form1 : Form
    {
        private string ip;
        public Form1()
        {
            InitializeComponent();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            GenericHttp generci = new GenericHttp();
            ip = generci.get("http://www.inf.furb.br/~afraulino/hmsshield/ip.php");
            string ip_host = generci.get("http://www.inf.furb.br/~afraulino/hmsshield/hms_ip_host.php");
            
            if (!ip_host.ToString().Equals(ip))
            {
                ip_host = ip;
                generci.post("http://www.inf.furb.br/~afraulino/hmsshield/hms_ip_host.php", new String[] { "ip=" + ip});
            }
            LIP.Text = ip;
        }
    }
}
